-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SECURITY] Bug fix for topN on draggables #70450
Conversation
Pinging @elastic/siem (Team:SIEM) |
@@ -95,6 +95,10 @@ const TopNComponent: React.FC<Props> = ({ | |||
const [view, setView] = useState<EventType>(defaultView); | |||
const onViewSelected = useCallback((value: string) => setView(value as EventType), [setView]); | |||
|
|||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding this to handle the scenario where a user changes the Timeline events filter while the graph is already open! 🙏
@elasticmachine merge upstream |
...ity_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.tsx
Show resolved
Hide resolved
...security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code review looks good, just had the one question on that test. pulled and manually tested a variety of timelines and all the filter managers are working as expected. hopefully this is the last bug! LGTM 👍
x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/manage_timeline/index.tsx
Outdated
Show resolved
Hide resolved
return ( | ||
useEffect(() => { | ||
setShowHoverContent(false); | ||
}, [closePopOverTrigger]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider declaring setShowHoverContent
as a dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need because it is from useState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here the explanation -> https://reactjs.org/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often
@@ -75,11 +75,12 @@ const escapeWhitespace = (val: string) => | |||
const escapeSpecialCharacters = (val: string) => val.replace(/["]/g, '\\$&'); // $& means the whole matched string | |||
|
|||
// See the Keyword rule in kuery.peg | |||
const escapeAndOr = (val: string) => val.replace(/(\s+)(and|or)(\s+)/gi, '$1\\$2$3'); | |||
// I do not think that we need that anymore since we are doing a full match_phrase all the time now => return `"${escapeKuery(val)}"`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some desk testing around this and agree 🙏
consider removing this meta-comment, and the commented-out definitions below 🙏
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes, refactoring, and ❤️ in this PR @XavierM! 🙏🙏🙏
I desk tested the Top N and Filter for / out context menu actions in Overview, Alerts, Events, Timeline, plus sub-contexts, including the Field and Value of expanded events, and in the Customize Columns view.
LGTM 🚀
* back to normal * add unit test * hover issue + indexToAdd issue * fix unit test * review II * fix bug + review * simplification * do not update state when component is unmounted * fix hover action on field name Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* back to normal * add unit test * hover issue + indexToAdd issue * fix unit test * review II * fix bug + review * simplification * do not update state when component is unmounted * fix hover action on field name Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: [APM-UI] e2e speed up build (elastic#70704) skip flaky suite (elastic#70764) skip flaky suite (elastic#70762) [Security Solution][Endpoint] Update to new manifest format (without compression) (elastic#70752) [functional tests] test url field formatter on dashboard and discover (elastic#70736) logout from transform_poweruser user in after method of transform tests (elastic#70644) [SECURITY] Bug fix for topN on draggables (elastic#70450) [Logs UI] Reorganise log rate anomaly table (elastic#69516) Update dependency @elastic/charts to v19.7.0 (elastic#69791) Add googlecloud metricbeat module to Kibana Home (elastic#70652) [Logs UI] Logs overview queries for the observability dashboard (elastic#70413) [Lens] Fitting functions (elastic#69820)
* master: [APM-UI] e2e speed up build (elastic#70704) skip flaky suite (elastic#70764) skip flaky suite (elastic#70762) [Security Solution][Endpoint] Update to new manifest format (without compression) (elastic#70752) [functional tests] test url field formatter on dashboard and discover (elastic#70736) logout from transform_poweruser user in after method of transform tests (elastic#70644) [SECURITY] Bug fix for topN on draggables (elastic#70450) [Logs UI] Reorganise log rate anomaly table (elastic#69516) Update dependency @elastic/charts to v19.7.0 (elastic#69791) Add googlecloud metricbeat module to Kibana Home (elastic#70652) [Logs UI] Logs overview queries for the observability dashboard (elastic#70413)
* actions/feature: fixed type errors [APM-UI] e2e speed up build (elastic#70704) skip flaky suite (elastic#70764) skip flaky suite (elastic#70762) [Security Solution][Endpoint] Update to new manifest format (without compression) (elastic#70752) [functional tests] test url field formatter on dashboard and discover (elastic#70736) logout from transform_poweruser user in after method of transform tests (elastic#70644) [SECURITY] Bug fix for topN on draggables (elastic#70450) [Logs UI] Reorganise log rate anomaly table (elastic#69516) Update dependency @elastic/charts to v19.7.0 (elastic#69791) Add googlecloud metricbeat module to Kibana Home (elastic#70652) [Logs UI] Logs overview queries for the observability dashboard (elastic#70413)
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
We lost some features on the
topN
due to the introduction of the global timeline context + we were doing some branching logic on i18n field.Now the branch logic is done on the timelineID and we will only get the
timelineId
when users hover the TopN icon just before they click on it. And applied the same logic for the filter management.Checklist
Delete any items that are not applicable to this PR.